home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / answrbok / 6_10.lha / 6_10 / lint.h < prev    next >
Text File  |  1993-08-08  |  2KB  |  55 lines

  1. * Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
  2. * The C++ Answer Book */
  3. * Tony Hansen */
  4. * All rights reserved. */
  5. * Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
  6. * The C++ Answer Book */
  7. * Tony Hansen */
  8. * All rights reserved. */
  9. / Define a 64 bit integer class
  10. / Exercise 6.10
  11. ifndef LINT_H
  12. define LINT_H
  13.  
  14. include <stream.h>
  15. include <string.h>
  16. include <error.h>
  17.  
  18. ypedef unsigned short LINT_type;
  19. ypedef unsigned long LINT_Ltype;
  20. include "6_10a2.h"    /* DELETE LINT_base */
  21.  
  22. lass LINT
  23.  
  24.    LINT_type s[4];
  25.  
  26. include "6_10a4.h"    /* DELETE isneg() */
  27. riend int LINT_cmp(const LINT_type *l1, const LINT_type *l2, int n);    /* DELETE */
  28. ublic:
  29. include "6_10a5.h"    /* DELETE dodivmod() */
  30.    LINT ();            // LINT x;
  31.    LINT (int j);        // LINT x = 3;
  32.    LINT (long j);        // LINT x = 3L;
  33.    LINT (unsigned int j);    // LINT x = 3;
  34.    LINT (unsigned long j);    // LINT x = 3L;
  35.    LINT (LINT& j);        // LINT x = LINT
  36.    LINT (unsigned long, unsigned long);    /* DELETE */
  37.    ~LINT ();
  38.  
  39.    LINT& operator= (LINT j);    // x = y;
  40.    LINT& operator= (int j);    // x = 5;
  41.    LINT& operator= (long j);    // x = 5L;
  42.  
  43.    friend LINT operator+ (LINT i, LINT j);
  44.    friend LINT operator+ (LINT j);
  45.    friend LINT operator- (LINT i, LINT j);
  46.    friend LINT operator- (LINT j);
  47.    friend LINT operator* (LINT i, LINT j);
  48.    friend LINT operator/ (LINT i, LINT j);
  49.    friend LINT operator% (LINT i, LINT j);
  50.  
  51.    friend ostream& operator<< (ostream& out, LINT j);
  52.    friend istream& operator>> (istream& in, LINT& j);
  53. ;
  54. endif /* LINT_H */
  55.